package com.wcy.util;

import org.springframework.http.ResponseEntity;

import java.util.Arrays;
import java.util.Random;

public class Util {
    private static final char[] CHAR_ARRAY = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
    public static String generateRandomCode(Integer length){
        Random random = new Random();
        char[] res = new char[length];
        for (int i = 0; i < res.length; i++) {
            res[i]= CHAR_ARRAY[random.nextInt(CHAR_ARRAY.length)];
        }
        return new String(res);
    }
}
